Overview
Theme Configuration
Library theme configuration is done by passing parameters into the Compose function DxChartsTheme
. The function takes the following parameters:
Name | Parameter name | Parameter Class | Default implementation | Description |
---|---|---|---|---|
Typography | typography | com.devexperts.dxcharts.lib.ui.theme.DxChartsTypography | com.devexperts.dxcharts.lib.ui.theme.DxChartsTypography | Fonts' types, styles, sizes |
Top Bar Icons | topBarIcons | com.devexperts.dxcharts.lib.ui.theme.icons.TopBarIcons | com.devexperts.dxcharts.lib.ui.theme.icons.DefaultTopBarIcons | Icons used in top bars |
Toolbar Icons | toolbarIcons | com.devexperts.dxcharts.lib.ui.theme.icons.ToolbarIcons | com.devexperts.dxcharts.lib.ui.theme.icons.DefaultToolbarIcons | Icons used in toolbars |
Studies Icons | studiesIcons | com.devexperts.dxcharts.lib.ui.theme.icons.StudiesIcons | com.devexperts.dxcharts.lib.ui.theme.icons.DefaultStudiesIcons | Icons used on screens related to indicators |
Shapes | shapes | com.devexperts.dxcharts.lib.ui.theme.DxChartsShapes | com.devexperts.dxcharts.lib.ui.theme.DxChartsShapes | Parameters for the rounding of UI elements |
Dimensions | dimensions | com.devexperts.dxcharts.lib.ui.theme.DxChartDimensions | com.devexperts.dxcharts.lib.ui.theme.DxChartDimensions | Paddings, margins, sizes |
Common Icons | commonIcons | com.devexperts.dxcharts.lib.ui.theme.icons.CommonIcons | com.devexperts.dxcharts.lib.ui.theme.icons.DefaultCommonIcons | Common library's icons |
And the last parameter of the function is content: @Composable () -> Unit
- Compose function to which the theme will be applied. When you use DxCharts library, this should be the function com.devexperts.dxcharts.lib.ui.DxChartsScreen
.
//...DxChartsTheme(/* overriden parameters of default */) {DxChartsScreen(/* overriden parameters of default */)}//...
Within the DxCharts library, parameters are passed using CompositionLocalProvider
, so the construction described above is essential for the library to function.